package com.chuangjiangx.member.stored.ddd.domain.model;

import java.util.Objects;

/**
 * @author cj-ch
 * @date 2018/4/4 下午6:46
 */
public enum MbrOrderType {
    RECHARGE("充值",1),
    CONSUME("消费",2);

    public final String name;
    public final Integer value;

    MbrOrderType(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public static final MbrOrderType of(Integer value){
        for(MbrOrderType type : MbrOrderType.values()){
            if(Objects.equals(type.value,value)){
                return type;
            }
        }
        return null;
    }
}
